package com.tron.xml;

import com.alibaba.fastjson.JSONObject;

public class XmlEnd {
    public static void main(String[] args) {
        String xmlString = "{\n" +
                "\t\"tron\":{\n" +
                "\t\t\"name\":{\n" +
                "\t\t\t\"#text\":\"tron\",\n" +
                "\t\t\t\"_id\":\"node_id1\",\n" +
                "\t\t\t\"_other\":\"what fuck\"\n" +
                "\t\t},\n" +
                "\t\t\"age\":\"100\",\n" +
                "\t\t\"favoriteBook\":{\n" +
                "\t\t\t\"like\":{\n" +
                "\t\t\t\t\"#text\":\"1\",\n" +
                "\t\t\t\t\"_task\":\"15\"\n" +
                "\t\t\t},\n" +
                "\t\t\t\"book\":[\n" +
                "\t\t\t\t{\n" +
                "\t\t\t\t\t\"author\":\"未知\",\n" +
                "\t\t\t\t\t\"name\":\"冰与火之歌\",\n" +
                "\t\t\t\t\t\"_id\":\"node_id2\"\n" +
                "\t\t\t\t},\n" +
                "\t\t\t\t{\n" +
                "\t\t\t\t\t\"author\":\"未知\",\n" +
                "\t\t\t\t\t\"name\":\"低俗小说\",\n" +
                "\t\t\t\t\t\"_id\":\"110\"\n" +
                "\t\t\t\t},\n" +
                "\t\t\t\t{\n" +
                "\t\t\t\t\t\"author\":\"未知1\",\n" +
                "\t\t\t\t\t\"name\":\"低俗小说1\",\n" +
                "\t\t\t\t\t\"time\":{\n" +
                "\t\t\t\t\t\t\"month\":\"03\",\n" +
                "\t\t\t\t\t\t\"year\":\"1983\",\n" +
                "\t\t\t\t\t\t\"day\":\"08\"\n" +
                "\t\t\t\t\t},\n" +
                "\t\t\t\t\t\"_id\":\"520\"\n" +
                "\t\t\t\t}\n" +
                "\t\t\t]\n" +
                "\t\t},\n" +
                "\t\t\"friends\":{\n" +
                "\t\t\t\"friend\":{\n" +
                "\t\t\t\t\"name\":\"lucy\",\n" +
                "\t\t\t\t\"age\":\"10\"\n" +
                "\t\t\t}\n" +
                "\t\t}\n" +
                "\t}\n" +
                "}";

        parseXmlString(xmlString);
    }

    public static String parseXmlString(String xmlString) {
        JSONObject jsonObject = JSONObject.parseObject(xmlString);
        System.out.println(jsonObject);
        return null;
    }
}
